import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/views/Home.vue'
import Layout from '@/views/Layout.vue'
import Node from '@/views/Node.vue'
import Pledge from '@/views/Pledge.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/',
    name: 'Layout',
    component: Layout,
    children: [
      { path: '/home', component: Home },
      { path: '/node', component: Node },
      { path: '/pledge', component: Pledge }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
